import React from 'react';

/**
 * 任务状态类型
 */
export type TaskStatus = 'todo' | 'inProgress' | 'done';

/**
 * 任务需求类型
 */
export type TaskType = '业务需求' | '科技专项';

/**
 * 业务需求子类型
 */
export type BusinessSubType = '业务自驱型' | '平台赋能型' | '联合攻坚型';

/**
 * 科技专项子类型
 */
export type TechSubType = '个人效能提升' | '公共工具建设' | '数字员工建设';

/**
 * 任务子类型
 */
export type TaskSubType = BusinessSubType | TechSubType;

/**
 * 需求复杂度
 */
export type TaskLevel = '高' | '中' | '低';

/**
 * 任务接口定义
 */
export interface Task {
  id: string | number;
  title: string;
  titleIndex?: string;
  status: TaskStatus;
  periodStartDate?: string;
  periodEndDate?: string;
  type: TaskType;
  subType: TaskSubType;
  level: TaskLevel;
  process?: number;
  thisWeekPlan?: string;
  nextWeekPlan?: string;
  problems?: string;
  parentId?: string;
  creater: string;
  receiver?: string;
  updater?: string;
  expectedDate?: string;
  finishedDate?: string;
  createdTime?: string;
  updateTime?: string;
}

/**
 * 任务看板列接口定义
 */
export interface TaskColumn {
  id: TaskStatus;
  title: string;
  icon: React.ReactNode;
  tasks: Task[];
}

/**
 * 任务查询参数
 */
export interface TaskQueryParams {
  title?: string;
  creater?: string;
  receiver?: string;
  type?: TaskType;
  subTypes?: TaskSubType[];
  isMyTask?: boolean;
  currentUser?: string;
}

/**
 * 获取根据任务类型对应的子类型选项
 * 
 * @param type 任务类型
 * @returns 子类型选项列表
 */
export const getSubTypesByType = (type?: TaskType): TaskSubType[] => {
  if (type === '业务需求') {
    return ['业务自驱型', '平台赋能型', '联合攻坚型'];
  } else if (type === '科技专项') {
    return ['个人效能提升', '公共工具建设', '数字员工建设'];
  }
  return [];
};

/**
 * 所有任务类型
 */
export const taskTypes: TaskType[] = ['业务需求', '科技专项'];

/**
 * 所有任务复杂度
 */
export const taskLevels: TaskLevel[] = ['高', '中', '低']; 